<%-- 
    Document   : sidebar-right
    Created on : 13-Nov-2012, 13:00:21
    Author     : Roald
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
        <link href="${requestScope.css}" type="text/css" rel="stylesheet" />
        <title> ${requestScope.title} </title>
    </head>
    <%out.println(request.getServletPath());%>


    <%@page import="nl.hva.web.mvcwebapp.models.Page"%>
    <%@page import="nl.hva.web.mvcwebapp.models.Widget"%>
    <%@page import="nl.hva.web.mvcwebapp.models.PageWidget"%>
    <%@page import="nl.hva.web.mvcwebapp.doa.PageDAO"%>
    <%
//        Page pagetastic = new Page();
//
//        pagetastic = PageDAO.getPage(1);
//        Widget widgetastic = PageDAO.getWidget(1);
//        PageWidget pageWidget = new PageWidget();
//        pageWidget.setPage(pagetastic);
//        pageWidget.setWidget(widgetastic);
//        pageWidget.setWidgetLocation(1);
//        PageDAO.insertPageWidget(pageWidget);

//        try {
//
//            pagetastic.setPageBackground((String) request.getAttribute("background"));
//            pagetastic.setPageColor((String) request.getAttribute("color"));
//            pagetastic.setPageLayout("sidebar_right");
//            pagetastic.setPageName((String) request.getAttribute("title"));
//            pagetastic.setPagePath(request.getServletPath());
//
//            PageDAO.insertPage(pagetastic);
//            out.print("added");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    %>
    <body class="${requestScope.background} ${requestScope.color}">
        <div class="bg">
            <div class="wrapper"> <!-- Start Wrapper -->
                <jsp:include page="${requestScope.header}" />
                <div class="content-wrapper">
                    <c:if test="${not empty requestScope.top}"> <jsp:include page="${requestScope.top}" /> </c:if>
                    <div class="sidebar right">
                        <c:if test="${not empty requestScope.sidebar_first}"> <jsp:include page="${requestScope.sidebar_first}" /> </c:if>
                        <c:if test="${not empty requestScope.sidebar_second}"><hr /><jsp:include page="${requestScope.sidebar_second}" /> </c:if>
                        <c:if test="${not empty requestScope.sidebar_third}"><hr /><jsp:include page="${requestScope.sidebar_third}" /> </c:if>
                    </div>

                    <div class="content left">
                        <!--page specific content -->
                        <jsp:include page="${requestScope.body}" />
                    </div>

                    <br class="clearfix">

                    <!-- Footer -->
                    <c:if test="${not empty requestScope.bottom}"> <hr /><jsp:include page="${requestScope.bottom}" /> </c:if>
                </div> <!-- End content-wrapper -->
                <c:if test="${not empty requestScope.footer}"> <jsp:include page="${requestScope.footer}" /> </c:if>
            </div> <!-- End Wrapper -->

        </div>
    </body>
</html>